<template>
  <div class="content_box">
    <div class="list">
      <div class="time">
        <p class="name">购买日期</p>
        <p class="text">2025-05-20</p>
      </div>
      <div class="msg">
        <div class="item">
          <p class="name">玉溪 x2</p>
          <p class="num">25元</p>
        </div>
        <div class="item">
          <p class="name">玉溪 x2</p>
          <p class="num">25元</p>
        </div>
      </div>
    </div>
    <div class="list">
      <div class="time">
        <p class="name">购买日期</p>
        <p class="text">2025-05-20</p>
      </div>
      <div class="msg">
        <div class="item">
          <p class="name">玉溪 x2</p>
          <p class="num">25元</p>
        </div>
        <div class="item">
          <p class="name">玉溪 x2</p>
          <p class="num">25元</p>
        </div>
      </div>
    </div>
    <div class="anniu-box">
      <p class="anniu" @click="saoma">去购买</p>
    </div>
  </div>
</template>

<script>
import {
    getRoles
} from '@/utils/auth'
import { Debounce } from "@/utils/index";
export default {
  data() {
    return {
      roles:getRoles()
    };
  },
  methods: {

    // 去购买
    saoma(){
      wx.scanCode({
        onlyFromCamera: true,
        success(res) {
          console.log(res)
          wx.navigateTo({
            url: `/${res.path}`,
          });
        }
      })
    }
  
  },
  onLoad(options){
  },
  onShow() {
    //console.log(this.roles)
  },
};
</script>

<style lang="scss" scoped>
.content_box{
  width: 100%;
  height: 100vh;
  background: #F5F5F5;
  padding-top:30rpx;
  .list {
    background: #fff;
    margin: 0 30rpx 20rpx 30rpx;
    padding: 30rpx;
    border-radius: 10rpx;
    .name {
      font-size: 32rpx;
      color: #333;
    }
    .time {
      font-size: 30rpx;
      color: #999;
      display: flex;
      justify-content: space-between;
      margin-bottom: 30rpx;
    }
    .msg {
      margin: 0 30rpx;
      .item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20rpx;
        padding-bottom: 20rpx;
        border-bottom: 1px solid #F5F5F5;
        &:last-child {
          margin-bottom: 0;
          border: none;
          padding-bottom: 0;
        }
        .num {
          color: #00C200;
          margin-left: auto;
          font-size: 30rpx;
          font-weight: 500;
        }
      }
    }
    
  }
}
.anniu-box{
  width: 100%;
  position: fixed;
  bottom: 50rpx;
  .anniu{
    margin: 0 30rpx;
    height: 80rpx;
    line-height: 80rpx;
    border-radius: 50rpx;
    text-align: center;
    font-weight: 500;
    color: #fff;
    background:#00C200;
    border:none;
    font-size: 32rpx;
    font-family: PingFangSC-Regular, PingFang SC;
  }
}

</style>